package com.yanxu.design02_builder.v4;

/**
 * @author 折戟沉沙铁未销
 * @version V1.0
 * @date 2025/4/14-2025
 * @Description: 这里用一句话描述这个类的作用
 */
public class Person {
    //基础信息
    private String name;
    private int age;
    private String gender;
    private String phone;
    private String email;
    //住址信息
    private String address;
    //爱好信息
    private String[] like;
    //身体信息
    private double weight;
    private double height;

    private Person() {
    }

    public Person(double height, double weight, String[] like, String address, String email, String phone, String gender, int age, String name) {
        this.height = height;
        this.weight = weight;
        this.like = like;
        this.address = address;
        this.email = email;
        this.phone = phone;
        this.gender = gender;
        this.age = age;
        this.name = name;
    }

    public static class PersonBuilder {
        Person person = new Person();

        public PersonBuilder buildBase(String name, int age, String gender, String phone, String email) {
            person.name = name;
            person.age = age;
            person.gender = gender;
            person.phone = phone;
            person.email = email;
            return this;
        }

        public PersonBuilder buildAddress(String address) {
            person.address = address;
            return this;
        }

        public PersonBuilder buildLike(String[] likes) {
            person.like = likes;
            return this;
        }

        public PersonBuilder buildBodyInfo(Double weight, Double height) {
            person.weight = weight;
            person.height = height;
            return this;
        }

        public Person buildPerson() {
            return person;
        }
    }
}